<?php include $this->admin_tpl('header'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo JS_PATH;?>EasyUI/themes/haidaoblue/easyui.css">
<link rel="stylesheet" type="text/css" href="<?php echo JS_PATH;?>EasyUI/themes/icon.css">
<script type="text/javascript" src="<?php echo JS_PATH;?>EasyUI/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH;?>EasyUI/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH;?>EasyUI/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH;?>EasyUI/hd_default_config.js"></script>
<div class="content" >
<div class="site">
	<?php echo C('site_name')?> <a href="#">返利中心</a> > 历史计划
</div>
<div id="cc" class="easyui-calendar"></div>
<span class="line_white"></span>
<div class="install mt10">
<div class="search_ind">
			<input type="hidden" name="m" value="<?php echo GROUP_NAME ?>">
			<input type="hidden" name="c" value="<?php echo MODULE_NAME ?>">
			<input type="hidden" name="a" value="<?php echo ACTION_NAME ?>">
             <span style="margin-right: 10px;">开始时间 </span>
                <input class="easyui-datebox" name="start" id="start" data-options="sharedCalendar:'#cc'">
                <span style="margin-right: 10px;">至</span>
                <input class="easyui-datebox" name="end" id="end" data-options="sharedCalendar:'#cc'" validType="md['#start']">
			<span style="margin-right: 10px;">搜索查询 </span>
			<input id="keyword" class="easyui-textbox" name="keyword" style="width:210px;height: 26px;" prompt="输入会员名称查询">
			<a id="search" href="javascript:;" class="easyui-linkbutton" style="height: 26px;padding-right: 10px;">查询</a>
		</div>
	<div class="login mt10" style="border: none;">
			<table id="loglist" style="width:100%"></table>
			<div class="clear"></div>
		</div>
		<?php include $this->admin_tpl("copyright"); ?>
		<div class="clear"></div>
</div>
<script type="text/javascript">
	var dom = $('#loglist');
	var pageSize = <?php echo PAGE_SIZE?>;
	var dataurl = '<?php echo U('old')?>';
	var keyword = '<?php echo $keyword?>';
	var user_id = '<?php echo $user_id?>';
	$(function(){
		dom.datagrid({
			url:dataurl,
			striped:true,
			width:'100%',
			checkOnSelect:true,
			singleSelect:true,
			fitColumns:true,
			pagination:true,
			pageSize:pageSize,
			pageList: [pageSize,pageSize*2,pageSize*4],//可以设置每页记录条数的列表
			columns:[[
				{field:'id',title:'编号',width:'20%',align:'center'},
				{field:'username',title:'用户名',width:'10%',align:'center'},
				{field:'pay_points',title:'变动金额',width:'11%',align:'center'},
				{field:'type',title:'类型',width:'10%',align:'center'},
				{field:'descript',title:'备注',width:'30%',align:'center'},
				{field:'time',title:'变动时间',width:'10%',align:'center',
					formatter:function(value,row,index){
  						return $.fn.datebox.defaults.timeformat(value);
					}
				},
			]],
		});
		//回车查询
		$('#keyword').textbox('textbox').bind('keydown',function (e) {
			if (e.keyCode == 13) {
				$('#search').trigger('click');
			}
		});
		
	});
//增加查询参数，重新加载表格
$('#search').bind('click',function (){
	var queryParams = dom.datagrid('options').queryParams;
	//查询参数直接添加在queryParams中
	queryParams.start = $('#start').datebox('getValue');
	queryParams.end = $('#end').datebox('getValue');
	queryParams.keyword = $("#keyword").val();
	dom.datagrid('options').queryParams = queryParams;
	dom.datagrid('reload');
})	
</script>
